<!-- addEditCatalog.html 2017-09-07 15:28:45-->
<div class="ibox">
	<div class="ibox-title">
		<h5>分类编辑</h5>
		<div class="pull-right">
			#if(askCatalog.id) <a href="javascript:" style="font-size:12px;color:#666" onclick="add(#(askCatalog.id))">新增子分类</a>  
			<a href="javascript:" style="font-size:12px;color:#666" onclick="add(#(askCatalog.parent_id))">新增同级分类</a>  #end
   		<a href="javascript:" style="font-size:12px;color:#666" onclick="closeEdit()">关闭</a>
    </div>
	</div>
	<div class="ibox-content">
		<form id="form" class="form-horizontal required-validate" method="post" action="saveCatalog" novalidate="novalidate" onsubmit="return validateCallback(this,thisAjaxDone)">
			<input type="hidden" name="askCatalog.id" value="#(askCatalog.id)"/>
			<input type="hidden" name="askCatalog.parent_id" value="#(askCatalog.parent_id)"/>
			
			<div class="form-group">
		   	<label class="col-xs-2 control-label">上级分类：</label>
		     <div class="col-xs-9" style="line-height: 35px">
		     #if(parentCatalog)#(parentCatalog.name)#else无#end
		     </div>
		  </div>
						<div class="form-group">
				<label class="col-xs-2 control-label">名称：</label>
				<div class="col-xs-4">
	<input type="text" class="form-control required" name="askCatalog.name" value="#(askCatalog.name)"/>
				</div>
				<label class="col-xs-2 control-label">图标：</label>
				<div class="col-xs-4">
	<input type="text" class="form-control " name="askCatalog.icon" value="#(askCatalog.icon)"/>
				</div>
			</div>						
			<div class="form-group">
				<label class="col-xs-2 control-label">封面：</label>
				<div class="col-xs-9">
    <div class="input-group">
    	<input type="text" class="form-control " name="askCatalog.image" id="askCatalog_image" value="#(askCatalog.image)"/>
   		<span class="input-group-btn">
   			<button class="btn btn-primary" type="button" onclick="layer.open({content:'#(path)/admin/#(param("FILES_UPLOAD_TYPE"))/upload?directory=ask&input=askCatalog_image',area: ['600px', '200px'],type: 2,title: '上传文件'})">上传</button>
   		</span>
   	</div>
				</div>
			</div>	
			<div class="form-group">
				<label class="col-xs-2 control-label">分类模板：</label>
				<div class="col-xs-4">
					<input type="text" class="form-control required" name="askCatalog.catalog_tpl" value="#(askCatalog.catalog_tpl??"catalog.html")"/>
				</div>
				<label class="col-xs-2 control-label">列表模板：</label>
				<div class="col-xs-4">
					<input type="text" class="form-control required" name="askCatalog.list_tpl" value="#(askCatalog.list_tpl??"list.html")"/>
				</div>
			</div>	
			<div class="form-group">
				<label class="col-xs-2 control-label">详情模板：</label>
				<div class="col-xs-4">
					<input type="text" class="form-control required" name="askCatalog.show_tpl" value="#(askCatalog.show_tpl??"show.html")"/>
				</div>
				<label class="col-xs-2 control-label">自定义链接：</label>
				<div class="col-xs-4">
					<input type="text" class="form-control" name="askCatalog.custom" value="#(askCatalog.custom)"/>
				</div>
			</div>	
			<div class="form-group">
				<label class="col-xs-2 control-label">是否推荐：</label>
				<div class="col-xs-4">
							#for(item:data("SHIFOU"))
		<label style="font-weight:normal;line-height: 37px;margin-bottom: 0px;padding-right: 5px"><input class="required" type="radio" name="askCatalog.is_good" #if(askCatalog.is_good)#if(askCatalog.is_good==item.key)checked="checked"#end#elseif(item.key=="T")checked="checked"#end value="#(item.key)"/> #(item.value.name) </label>
		#end
				</div>
				
				<label class="col-xs-2 control-label">允许提问：</label>
				<div class="col-xs-4">
		#for(item:data("SHIFOU"))
		<label style="font-weight:normal;line-height: 37px;margin-bottom: 0px;padding-right: 5px"><input class="required" type="radio" name="askCatalog.is_select" #if(askCatalog.is_select)#if(askCatalog.is_select==item.key)checked="checked"#end#elseif(item.key=="T")checked="checked"#end value="#(item.key)"/> #(item.value.name) </label>
		#end
				</div>
			</div>	
			<div class="form-group">
				<label class="col-xs-2 control-label">排序：</label>
				<div class="col-xs-4">
		<input type="text" class="form-control digits required" name="askCatalog.sort" value="#(askCatalog.sort??"100")"/>
				</div>
				<label class="col-xs-2 control-label">状态：</label>
				<div class="col-xs-4">
		#for(item:data("ENABLE_FLAG"))
		<label style="font-weight:normal;line-height: 37px;margin-bottom: 0px;padding-right: 5px"><input class="required" type="radio" name="askCatalog.enable_flag" #if(askCatalog.enable_flag)#if(askCatalog.enable_flag==item.key)checked="checked"#end#elseif(item.key=="T")checked="checked"#end value="#(item.key)"/> #(item.value.name) </label>
		#end
				</div>
			</div>		  <div class="form-group">
		   	<div class="col-xs-9 col-xs-offset-2">
		     	<button type="submit" class="btn btn-primary">保存</button>
		     	#if(askCatalog.id)
		     		  <a class="btn btn-danger" href="deleteCatalog?id=#(askCatalog.id)" target="ajaxTodo" title="确定删除吗？" callback="deleteAjaxTodo">删除</a>
		     	#end
		    </div>
		  </div>
		</form>
 	</div>
</div>